{% extends "templates/base.phtml" %}
{%block content%}
{% if wxc is defined %}
<script type="text/javascript" charset="utf-8" src="/assets/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/assets/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/assets/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    var ue = UE.getEditor('editor');
    UE.getEditor('editor');
</script>
<div class="page-content-wrap">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default tabs">
                {%include 'include/wx_tabs' with ['action':'reply']%}
                <div class="panel-body tab-content">
                    <div class="tab-pane active">
                        <div class="col-md-12">
                            <div class="col-md-3 col-xs-6 pull-left">
                                <h3>新建图文自定义内容</h3>
                            </div>
                            <div class="col-md-2 col-xs-2 pull-right">
                                <a class="btn btn-success back" href="/admin/appwx/img">返回</a>
                            </div>
                            <form class="form-horizontal" method="post">
                                <div class="panel panel-default">
                                    <div class="panel-body def-pan-bd">
                                        <div class="col-bd col-md-12 col-xs-12">
                                            <div class="col-md-10 col-xs-10 form-horizontal">
                                                <div class="form-group">
                                                    <label class="col-md-3 col-xs-12 control-label">关键词：</label>
                                                    <div class="col-md-6 col-xs-12">
                                                        <div class="input-group">
                                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                            <input name="keyword" type="text" class="form-control">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-3 col-xs-12 control-label">标题：</label>
                                                    <div class="col-md-6 col-xs-12">
                                                        <div class="input-group">
                                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                            <input name="title" type="text" class="form-control">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-3 col-xs-12 control-label">简介：</label>
                                                    <div class="col-md-6 col-xs-12">
                                                        <textarea name="intro" class="form-control" placeholder="请输入简介"></textarea>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-3 col-xs-12 control-label">封面图片：</label>
                                                    <div class="col-md-6 col-xs-12">
                                                        <input id="fileup" name="fileup" type="file" multiple="true">
                                                        <input id="pic" name="pic" class="form-control"  type="hidden" value="">
                                                        <img id="thumb" src="" style="max-height: 200px;max-width: 200px">
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label class="col-md-3 col-xs-12 control-label">内容：</label>
                                                    <div class="col-md-6 col-xs-12">
                                                        <script id="editor" type="text/plain" style="width:550px;height:300px;"></script>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-3 col-xs-12 control-label">链接URL：</label>
                                                    <div class="col-md-6 col-xs-12">
                                                        <input name="url" type="text" class="form-control">
                                                    </div>
                                                </div>
                                                <div class="form-group col-md-12">
                                                    <div class="col-md-6 col-xs-12 col-md-offset-4">
                                                        <button class="btn btn-primary">保存</button>
                                                        <button class="btn btn-danger">取消</button>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{%endif%}
{%endblock%}
{%block end%}
<style type="text/css">
    .back{
        position: relative;
        bottom: 5px;
    }
</style>
<script src="/assets/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/assets/uploadify/uploadify.css">
<script type="text/javascript">


    $(function() {
        $('#fileup').uploadify({
            'formData'     : {
            },
            'swf'      : '/assets/uploadify/uploadify.swf',
            'uploader' : '/admin/resource/upload',
            'cancelImg': '/assets/uploadify/uploadify-cancel.png',//单个取消上传的图片
            'onUploadSuccess': function (file, data, response) {
                var data = JSON.parse(data);
                if (data.status == 1) {
                    $('#pic').val(data.data);
                    $('#thumb').attr("src",data.data);
                    $('#thumb').css("display","block");
                }
            }
        });

    });
</script>
{%endblock%}